Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update formatting for source and header files #130

Merged
merged 4 commits into from Jun 22, 2023
Merged

Update formatting for source and header files #130

merged 4 commits into from Jun 22, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jun 21, 2023

Hello!

I want to introduce some updates to string handling: move from %s formatting to f-string.
That makes the code a bit more readable and faster.

Also, I changed how source and header files are written (basically, I just moved to the writelines method).

I hope you will find those changes useful.

@ghost ghost changed the title Update fomating for source and header files Update formatting for source and header files Jun 21, 2023
ilya.kuksenok added 4 commits June 22, 2023 01:56
Signed-off-by: ilya.kuksenok <[email protected]>
Signed-off-by: ilya.kuksenok <[email protected]>
Signed-off-by: ilya.kuksenok <[email protected]>
Signed-off-by: ilya.kuksenok <[email protected]>
@ghost
Copy link
Author

ghost commented Jun 22, 2023

@giuseppe could you review this pr?

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no clue about write vs append in python. @Ilya-source does it creates a significant difference ?

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR LGTM overall apart from the one doubt above.

@giuseppe
Copy link
Member

@Ilya-source thanks for opening the PR, could you please open a PR for crun that uses this version of libocispec to see if there are any regressions?

@giuseppe
Copy link
Member

actually we don't need that, I've verified the generated source is the same

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe giuseppe merged commit 3d16826 into containers:main Jun 22, 2023
6 checks passed
@ghost
Copy link
Author

ghost commented Jun 22, 2023

@flouthoc

I have no clue about write vs append in python. @Ilya-source does it creates a significant difference ?

That makes code a bit easier to debug in python debugger, and this is faster, of course, in this project this was not that important, because this is just a one time generation step, but still. :)

@flouthoc
Copy link
Collaborator

@Ilya-source Thanks for the info and the PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants